MakeRGBPat
To create the appearance of otherwise unavailable colors on indexed devices, you can use theMakeRGBPat
procedure.
PROCEDURE MakeRGBPat (ppat: PixPatHandle; myColor: RGBColor);
ppat
- A handle to hold the generated pixel pattern.
myColor
- An
RGBColor
record that defines the color you want to approximate.DESCRIPTION
TheMakeRGBPat
procedure generates aPixPat
record that, when used to draw a pixel pattern, approximates the color you specify in themyColor
parameter. For example, if your application draws to an indexed device that supports 4 bits per pixel, you only have 16 colors available if you simply set the foreground color and draw. If you useMakeRGBPat
to create a pattern, and then draw using that pattern, you effectively get 125 different colors. If the graphics device has 8 bits per pixel, you effectively get 2197 colors. (More colors are theoretically possible; this implementation opted for a fast pattern selection rather than the best possible pattern selection.)For a pixel pattern, the
patMap^^.bounds
field of thePixPat
record always contains the values (0,0,8,8), and thepatMap^^.rowbytes
field equals 2.SPECIAL CONSIDERATIONS
Because patterns produced withMakeRGBPat
aren't usually solid--they provide a selection of colors by alternating between colors, with up to four colors in a pattern-- lines that are only one pixel wide may not look good.When
MakeRGBPat
creates aColorTable
record, it fills in only thergb
fields of itsColorSpec
records; thevalue
fields are computed at the time the drawing actually takes place, using the current pixel depth for the system.